<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app1">
<!--  组件：全局组件、局部组件      -->
       <mycomponent1></mycomponent1>
    </div>

    <div id="app2">
        <mycomponent1></mycomponent1>
    </div>
</body>
    <script>
        //定义第一个全局组件:可以在任意Vue实例中使用它
        Vue.component("mycomponent1",{
            template:"<h1>这是第一个全局组件</h1>"
        })

        new Vue({
            el:"#app1",
            data:{},
            methods:{}

        })

        new Vue({
            el:"#app2",
            data:{},
            methods:{}

        })
    </script>
</html>